<template>
  <div class="electricVehicleSupplies">
    <div class="head">
      <carousel :imgdata="imgdata" :height="443"></carousel>
    </div>
    <div class="ma-left f-l">
      <div class="AD1">
        <picturesShow :proList="AD1" width="245" height="360" radius="2"></picturesShow>
      </div>

      <div class="recommend">
        <titleBox :styleData="title1styleData">
          <template #title>{{ merchandiseQuality.title }}</template>
        </titleBox>

        <div class="item" v-for="listData in merchandiseQuality.list" :key="listData.id">
          <div class="le f-l">
            <router-link :to="{name:'products',params:{proid:listData.id}}">
              <img :src="listData.imageMain" alt />
            </router-link>
          </div>
          <div class="ri f-r">
            <router-link :to="{name:'products',params:{proid:listData.id}}">
              <span>{{listData.commodityAttr}}</span>
            </router-link>
            <div>￥{{ listData.price }}</div>
          </div>
        </div>

      </div>

      <div class="serviceTel">
        <img
          src="http://demo.sc.chinaz.net/Files/DownLoad/moban/201807/moban3095/image/catalog/banners/call-us.jpg"
          alt
        />
        <ul>
          <li v-for="item in 5" :key="item.id">
            <i class="el-icon-eleme"></i>
            <span>优质服务</span>
            <span>1小时到货1小时到货</span>
          </li>
        </ul>
      </div>
    </div>
    <div class="ma-right f-l">
      <div class="introduce">
        <picturesShow :proList="proList" width="235" height="150" radius="5"></picturesShow>
      </div>
      <!-- 秒杀模块已注释 -->
      <!-- <div class="SecondsKillEveryDay">
        <titleBox :styleData="title1styleData">
          <template #title>内容标题</template>
          <template #box1>
            <div class="countDown">
              <div>00</div>
              <div>:</div>
              <div>00</div>
              <div>:</div>
              <div>00</div>
              <div>:</div>
              <div>00</div>
            </div>
          </template>
          <template #box2>
            <ul class="customText">
              <li>选项</li>
              <li>选项</li>
              <li>选项</li>
              <li>选项</li>
              <li>选项</li>
              <li>选项</li>
              <li>更多>></li>
            </ul>
          </template>
        </titleBox>

        <div class="goods flex">
          <div class="item" v-for="item in 5" :key="item.id">
            <img
              src="https://img2.tuhu.org/Images/Products/FtxGH-lK3FE7f62nTmlTQWgmH1Ye_w800_h800.jpeg@110w_110h_100Q.jpg"
              alt
            />
            <span>电子后视镜</span>
            <span>￥50</span>
            <el-progress :text-inside="true" :stroke-width="20" :percentage="50" status="exception"></el-progress>
            <span>100人已卖</span>
          </div>
        </div>
      </div>-->
      <div class="ADIMG marbo50">
        <picturesShow :proList="AD2" radius="2"></picturesShow>
      </div>
      <ListOfGoods v-for="item in mainProducts" :key="item.id" :header="item"></ListOfGoods>
      <div class="marbo50"></div>

      <div class="marbo50">预约维修服务等等结束</div>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
import carousel from "@/components/carousel/carousel";
import picturesShow from "@/components/picturesShow/picturesShow";
import titleBox from "@/components/titleBox/titleBox";
import ListOfGoods from "./ListOfGoods";
export default {
  data() {
    return {
      merchandiseQuality:'',
      imgdata:'',
      title1styleData: {
        height: "30px",
        width: "100px"
      }
    };
  },
  computed: {
    AD1: function() {
      return this.$api.commonAPI.getAD(1);
    },
    AD2: function() {
      return this.$api.commonAPI.getAD(2);
    },
    proList: function() {
      //首页轮番图下面的广告
      return this.$api.commonAPI.getAD(4);
    },
    mainProducts: function() {
      //主要的几个商品展示
      var data = this.$api.mallAPI.getMainProducts();
      this.$store.commit("MainProductsVuexUpdata", data.list);
      return data.header;
    },

  },
  created: function() {
    this.$api.commonAPI.getCommodity(4).then(response => {
      this.merchandiseQuality = response.data;
    });

    this.$api.commonAPI.getAD(3).then(response => {
      this.imgdata = response.data;
      console.log(this.imgdata)
    });


  },
  methods: {},
  components: { carousel, picturesShow, titleBox, ListOfGoods }
};
</script>

<style lang="scss" type="text/css" scoped>
@import "@/common/style.scss";
.electricVehicleSupplies {
  height: 3200px;

  background-color: white;
  .btDOM {
    height: 40px;
    line-height: 40px;
    border-bottom: rgb(240, 240, 240) 5px solid;
    color: rgb(43, 43, 43);
    position: relative;

    .btspan {
      display: block;
      height: 40px;
      line-height: 40px;
      width: 100px;
      border-bottom: $main-color 5px solid;
    }
  }
  // background-color: white;
  .el-carousel .el-carousel--horizontal {
    width: 1900px;
  }
  width: 1300px;
  margin: 0 auto;
  .head {
    background-color: rgb(238, 238, 238);
    margin-bottom: 50px;
  }

  .ma-left {
    .AD1 {
      img {
        width: 80%;
      }
      margin-bottom: 50px;
    }
    .recommend {
      // margin: 20px 0px;
      // background-color: white;

      .item {
        padding: 15px;
        font-size: 14px;
        line-height: 20px;
        height: 100px;

        .le {
          img {
            width: 100px;
            height: 100px;
          }
        }

        .ri {
          width: 140px;
          height: 100px;
          padding-left: 10px;
          font-size: 13px;
          div {
            font-size: 16px;
            color: red;
          }
        }
      }
      margin-bottom: 50px;
    }

    .serviceTel {
      border: 1px rgba(196, 196, 196, 0.658) solid;
      border-radius: 5px;
      img {
        width: 100%;
        border-left: 5px;
      }
      ul {
        padding: 25px;
        li {
          position: relative;
          border-bottom: 1px rgba(216, 216, 216, 0.658) solid;
          margin-bottom: 10px;
          i {
            width: 50px;
            height: 50px;
            font-size: 50px;
            color: rgb(241, 65, 65);
          }
          span {
            position: absolute;
          }
          span:nth-child(3) {
            left: 60px;
            top: 25px;
            font-size: 14px;
          }
          span:nth-child(2) {
            top: 5px;
            left: 60px;
          }
        }
      }
      margin-bottom: 50px;
    }
  }

  .ma-right {
    width: 1000px;
    padding: 10px;
    .introduce {
      img {
        border-radius: 5px;
        width: 235px;
        height: 150px;
      }

      margin-bottom: 50px;
    }

    .SecondsKillEveryDay {
      .btDOM {
      }
      .goods {
        .item {
          width: 167px;
          img {
            width: 100%;
          }
        }
      }
      margin-bottom: 50px;
    }
    .artBox {
      // background-color: beige;
      .btDOM {
      }

      .box {
        margin-top: 15px;
        .boxItem {
          width: 200px;
          img {
            width: 85%;
          }
          text-align: center;
          span:nth-child(1) {
          }
        }
      }
    }
  }
}

.countDown {
  height: 50px;
  font-size: 20px;
  color: red;
  div {
    float: left;
  }
  // div:nth-child(-n+4){background:#090}
  div:nth-child(2n-1) {
    background: rgb(89, 124, 89);
    width: 2em;
    text-align: center;
    background-color: $main-color;
    color: white;
    border-radius: 5px;
  }
  div:nth-child(2n) {
    margin: 0px 3px;
  }
}
</style>
